package learningtests;

import static org.junit.Assert.*;

import org.junit.Test;

public class MathOperationLearning {

    @Test
    public void testPlusWithPercentage() {
        int source = 8 * 1024;
        double factor = 1.02;

        int result = (int) Math.abs(source * factor);
        System.out.println("After computed: " + result);
        int incremented = result - source;
        System.out.println("Incremented: " + incremented);
    }
    
    @Test
    public void testMath() {
        int totalCharsRead = 2025013;
        int expectedChar = 9781;
        final int BLOCK_SIZE = 16 * 1024;
        
        int actual = totalCharsRead % BLOCK_SIZE;
        
        assertEquals(expectedChar, actual);
    }
}
